<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>招标项目管理</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %> 
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <!-- 操作列更多弹窗 -->
    <div class="box box-primary" id="more" style="width:100px;height:35px;background-color:#2C3B41;position:absolute;z-index:9999;left:850px;top:100px;display:none;font-size:12px;border-top-color:#2C3B41;">
            <div class="box-body home-message" id="moreOp">
            </div>
    </div>

    <section class="content-header">
        <h1>评分结果查看</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">药品招标管理</a></li>
            <li class="active"><a href="#">评标管理</a></li>
            <li class="active"><a href="#">评分结果查看</a></li>
        </ol>
    </section>
    <section class="content">
       <form id="form" method="post" class="form-horizontal">
        <div class=" box box-success">
            <div class="box-body">
                <div class="input">
                    <div class="textalign1">项目名称：</div>
                    <div class="boxinput">
                        <select class="textinput" id="projId" name="projId"></select>
                    </div>                  
                    <div class="textalign">类型：</div>
                    <div class="boxinput">
                        <select class="textinput" id="projCat" name="projCat">
                        	<option value="">请选择</option>
                        	<option value="1">招标采购</option>
                        	<option value="2">谈判采购</option>
                        	<option value="3">定点生产</option>
                        	<option value="4">直接采购</option>
                        </select>
                    </div>
                     <div class="textalign">项目类型：</div>
                    <div class="boxinput">
                        <input class="textinput" id="drugCode" placeholder="药品编码" />
                    </div>
                </div>
                <div class="input">
                    <div class="textalign1">通用名：</div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="qualityspecName" placeholder="通用名"/>
                    </div>
                    <div class="textalign">企业编码：</div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="compCode" placeholder="企业编码"/>
                    </div>
                    <div class="textalign">企业名：</div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="compName" placeholder="企业名"/>
                    </div>
                </div>
                <div class="input">
                    <div class="textalign1" >
                        <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm">查&nbsp;询</button>
                    </div>  
                </div>
            
               <!--<div class=" form-inline">               
                	<div class="form-group form-group-xs">
                	    <label for="txtDrugName">项目名称：</label>
					    <select class="form-control" style="width:220px;" id="projId" name="projId"></select>
                	</div>
                	<div class="form-group form-group-xs">
                        <label for="txtDrugForm">类型：</label>
                        <select class="form-control"  id="projCat" name="projCat">
                        	<option value="">请选择</option>
                        	<option value="1">招标采购</option>
                        	<option value="2">谈判采购</option>
                        	<option value="3">定点生产</option>
                        	<option value="4">直接采购</option>
                        </select>
                    </div>
                	<%-- <div class="form-group form-group-xs">
                	    <label for="txtDrugName">项目类型：</label>
					    <select class="form-control" style="width:220px;" id="projCat" name="projCat">
					    <option value="">请选择</option>
					    <c:choose>
					    	<c:when test="${!empty projCatList }">
					    		<c:forEach items="${projCatList }" var="projCatList">
					    			<option value="${projCatList.dicCode }">${projCatList.dicName}</option>
					    		</c:forEach>
					    	</c:when>
					    </c:choose>
					    </select>
                	</div> --%>
                	<div class="form-group form-group-xs">
                    	<label>药品编号：</label>
                        <input class="form-control" type="text" id="drugCode" placeholder="药品编码" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label>通用名：</label>
                        <input class="form-control" type="text" id="qualityspecName" placeholder="通用名" />
                    </div>
                    <div class="form-group form-group-xs">
                    	<label>企业编号：</label>
                        <input class="form-control" type="text" id="compCode" placeholder="企业编码" />
                    </div>
                    <div class="form-group form-group-xs">
                        <label>企业名：</label>
                        <input class="form-control" type="text" id="compName" placeholder="企业名" />
                    </div>
                     
                    <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm"> 查&nbsp;询</button>
                </div>-->
            </div>
          </div>
        </form>  
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>

    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %> 
    <script type="text/javascript">
    $(function(){
		$("#projId").HNSelect({
            url: "${pageContext.request.contextPath}/selectController/getDicBidCompany.html", data: { ID: '' }, defaultText: "<option value=''>请选择</option>",
        });
	});
    
    
        
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/bidScoreRule/getScreResultDataList.html",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                shrinkToFit:false,
                height: 270,
                colNames: [ '操作','项目ID','项目药品ID','bidProjdrugsScoreId','评分对象类型','主观分','客观分','总得分', '项目名称', '项目类型','药品编码','通用名','剂型','规格','转换系数','单位','材质','企业名称'],
                colModel: [
					{ name: 'operate', width: 60,sortable: false, align:"center",
						formatter : function(val, opts, rowdata) {
							var str = "";
							str += "<a href='${ctx}/bidScoreRule/toScoreResultDetail.html?projId="+rowdata.projId+"&name="+rowdata.name+"&bidProjdrugsScoreId="+rowdata.bidProjdrugsScoreId+"&qualityspecName="+rowdata.qualityspecName+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='详情'></a>";
							return str;
						}	 },
                    { name: 'projId', width: 60,hidden:true , align:"center" ,sortable: false},
                    { name: 'projProddrugId', width: 80,hidden:true , align:"center" ,sortable: false},
                    { name: 'bidProjdrugsScoreId', width: 120 ,hidden:true, align:"center",sortable: false},
                    { name: 'scoreObjectType', width: 120 , align:"center",sortable: false,
                    	formatter:function(val,opts,rowdata){
                    		var str="";
                    		if(val==1){
                    			return str="企业资质";
                    		}else if(val==2){
                    			return str="药品资质";
                    		}else if(val==3){
                    			return str="其他";
                    		}
                    		return str;
                    	}},
                    { name: 'scoreSubject', width: 120 , align:"center",sortable: false},
                    { name: 'scoreObject', width: 120 , align:"center",sortable: false},
                    { name: 'totalScore', width: 120 , align:"center" ,sortable: false,},
                    { name: 'name', width: 220 , align:"center" ,sortable: false},
                    { name: 'projCat', width: 100 , align:"center" ,sortable: false},
                    { name: 'drugCode', width: 120 , align:"center" ,sortable: false},
                    { name: 'qualityspecName', width: 160 , align:"center" ,sortable: false},
                    { name: 'formName', width: 100 , align:"center" ,sortable: false},
                    { name: 'specName', width: 100 , align:"center" ,sortable: false},
                    { name: 'factor', width: 60 , align:"center" ,sortable: false},
                    { name: 'unit', width: 60 , align:"center" ,sortable: false},
                    { name: 'materialName', width: 80 , align:"center" ,sortable: false},
                    { name: 'compName', width: 190 , align:"center" ,sortable: false,
                    	formatter:function(cellvalue, options, row){ 
                    		return "<a href=\"javascript:$.HN.dialog.opendialog('"+cellvalue+"','企业详情','${ctx}/stdCompinfo/toStdCompinfoDetailJsp.html?compCodeDetail="+row.compCode+"','800px','400px',function operResult(val){return operResult;})\">"+cellvalue+"</a>"
                    }}
                    
                ],
                rowNum: 20,
                rowList: [10,20,50,100],
                rownumbers: true,
                pager: "#gridpage",
                //multiselect: true, 
                viewrecords: true,
                caption: "评分结果列表",
                jsonReader: {
                    repeatitems: false,
                    id: "projId"
                },
                gridComplete: function(){
                	var page = $("#gridlist").jqGrid('getGridParam','page');
            		var rows = $('#gridlist').getGridParam("rowNum");
            		var maxnum = (rows*page).toString();
            		var len = (maxnum.length)*10;
            		$('.jqgfirstrow').find('td').eq(0).css('width',len+'px');
                	$('#gridlist_rn').css('width',len+'px');
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");  
        });
        

        //查询
        function gridSerch() {
            var projId = $("#projId").val();
            var projCat = $("#projCat").val();
            var drugCode = $("#drugCode").val();
            var qualityspecName = $("#qualityspecName").val();
            var compCode = $("#compCode").val();
            var compName = $("#compName").val();
            $("#gridlist").jqGrid('setGridParam',{  
                datatype:'json',
                postData:{
                		"projId":projId,
                		"projCat":projCat,
                		"drugCode":drugCode,
                		"qualityspecName":qualityspecName,
                		"compCode":compCode,
                        "compName":compName}
            }).trigger("reloadGrid"); //重新载入  
        }
        
        
      
	   
 
    </script>
</body>
</html>